home *** CD-ROM | disk | FTP | other *** search
/ mail.altrad.com / 2015.02.mail.altrad.com.tar / mail.altrad.com / TEST / office german / PROPLUS.WW / PROPLSWW.CAB / MSORES.DLL / 226 / 650 next >
Extensible Markup Language  |  2006-10-26  |  7KB  |  196 lines

  1. <?xml version="1.0" ?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:output omit-xml-declaration="yes" indent="yes" />
  4. <xsl:param name="BiDi">false</xsl:param>
  5. <xsl:template match="/">
  6. <xsl:apply-templates />
  7. </xsl:template>
  8. <xsl:template match="ARTICLES">
  9. <xsl:apply-templates />
  10. </xsl:template>
  11. <xsl:template match="ARTICLE">
  12. <xsl:choose>
  13. <xsl:when test="Headword | */Headword">
  14. <xsl:apply-templates select="Headword | */Headword"/>
  15. </xsl:when>
  16. <xsl:when test="Num">
  17. <xsl:apply-templates select="Num"/>
  18. </xsl:when>
  19. <xsl:when test="NEWLINE">
  20. <xsl:variable name="NextNewlineList" select="NEWLINE[1] | NEWLINE[1]/following-sibling::node()"></xsl:variable>
  21. <xsl:variable name="CurrentList" select="node()"></xsl:variable>
  22. <xsl:variable name="ApplyList" select="$CurrentList [ count( . | $NextNewlineList) != count( $NextNewlineList) ]"></xsl:variable>
  23. <xsl:if test="$ApplyList">
  24. <P>
  25. <xsl:apply-templates select="$ApplyList"/>
  26. </P>
  27. </xsl:if>
  28. <xsl:apply-templates select="NEWLINE"/>
  29. </xsl:when>
  30. <xsl:otherwise>
  31. <P>
  32. <xsl:apply-templates />
  33. </P>
  34. </xsl:otherwise>
  35. </xsl:choose>
  36. </xsl:template>
  37. <xsl:template match="Homograph">
  38. <xsl:text> (</xsl:text>
  39. <xsl:apply-templates />
  40. <xsl:text>)</xsl:text>
  41. </xsl:template>
  42. <xsl:template match="Phon">
  43. </xsl:template>
  44. <xsl:template match="B">
  45. <xsl:choose>
  46. <xsl:when test="I">
  47. <Char bold="true" italic="true">
  48. <xsl:apply-templates select="I/text()"/>
  49. </Char>
  50. </xsl:when>
  51. <xsl:otherwise>
  52. <Char bold="true">
  53. <xsl:apply-templates />
  54. </Char>
  55. </xsl:otherwise>
  56. </xsl:choose>
  57. </xsl:template>
  58. <xsl:template match="Headword">
  59. <xsl:variable name="NextHeadwordList" select="following-sibling::Headword[1] | following-sibling::Headword[1]/following-sibling::node()"></xsl:variable>
  60. <xsl:variable name="NextNumList" select="following-sibling::Num[1] | following-sibling::Num[1]/following-sibling::node()"></xsl:variable>
  61. <xsl:variable name="NextNewlineList" select="following-sibling::NEWLINE[1] | following-sibling::NEWLINE[1]/following-sibling::node()"></xsl:variable>
  62. <xsl:variable name="CurrentList" select="following-sibling::node()"></xsl:variable>
  63. <xsl:variable name="ExcludeListHeadwordNum" select="$NextHeadwordList | $NextNumList"></xsl:variable>
  64. <xsl:variable name="ExcludeList" select="$ExcludeListHeadwordNum | $NextNewlineList"></xsl:variable>
  65. <xsl:variable name="ApplyList" select="$CurrentList [ count( . | $ExcludeList) != count( $ExcludeList) ]"></xsl:variable>
  66. <xsl:variable name="NumList" select="following-sibling::Num [ count( . | $NextHeadwordList) != count( $NextHeadwordList) ]"></xsl:variable>
  67. <xsl:variable name="NewlineList" select="following-sibling::NEWLINE [ count( . | $ExcludeListHeadwordNum) != count( $ExcludeListHeadwordNum) ]"></xsl:variable>
  68. <Heading>
  69. <Text>
  70. <xsl:apply-templates/>
  71. </Text>
  72. <xsl:attribute name="level">2</xsl:attribute>
  73. <xsl:attribute name="collapsible">true</xsl:attribute>
  74. <xsl:attribute name="collapsed">false</xsl:attribute>
  75. <xsl:variable name="sApplyList">
  76. <xsl:apply-templates select="$ApplyList"/>
  77. </xsl:variable>
  78. <xsl:if test="$sApplyList!=''">
  79. <xsl:if test="$ApplyList">
  80. <P>
  81. <xsl:apply-templates select="$ApplyList"/>
  82. </P>
  83. </xsl:if>
  84. </xsl:if>
  85. <xsl:if test="$NewlineList">
  86. <xsl:apply-templates select="$NewlineList"/>
  87. </xsl:if>
  88. <xsl:if test="$NumList">
  89. <xsl:apply-templates select="$NumList"/>
  90. </xsl:if>
  91. </Heading>
  92. </xsl:template>
  93. <xsl:template match="I">
  94. <xsl:choose>
  95. <xsl:when test="B">
  96. <Char bold="true" italic="true">
  97. <xsl:apply-templates select="B/text()"/>
  98. </Char>
  99. </xsl:when>
  100. <xsl:otherwise>
  101. <Char italic="true">
  102. <xsl:apply-templates />
  103. </Char>
  104. </xsl:otherwise>
  105. </xsl:choose>
  106. </xsl:template>
  107. <xsl:template match="Label">
  108. <Char smallCaps="true">
  109. <xsl:apply-templates />
  110. </Char>
  111. </xsl:template>
  112. <xsl:template match="Num">
  113. <xsl:variable name="NextHeadwordList" select="following-sibling::Headword[1] | following-sibling::Headword[1]/following-sibling::node()"></xsl:variable>
  114. <xsl:variable name="NextNumList" select="following-sibling::Num[1] | following-sibling::Num[1]/following-sibling::node()"></xsl:variable>
  115. <xsl:variable name="NextNewlineList" select="following-sibling::NEWLINE[1] | following-sibling::NEWLINE[1]/following-sibling::node()"></xsl:variable>
  116. <xsl:variable name="CurrentList" select="following-sibling::node()"></xsl:variable>
  117. <xsl:variable name="ExcludeListHeadwordNum" select="$NextHeadwordList | $NextNumList"></xsl:variable>
  118. <xsl:variable name="ExcludeList" select="$ExcludeListHeadwordNum | $NextNewlineList"></xsl:variable>
  119. <xsl:variable name="ApplyList" select="$CurrentList [ count( . | $ExcludeList) != count( $ExcludeList) ]"></xsl:variable>
  120. <xsl:variable name="NewlineList" select="following-sibling::NEWLINE [ count( . | $ExcludeListHeadwordNum) != count( $ExcludeListHeadwordNum) ]"></xsl:variable>
  121. <P>
  122. <xsl:choose>
  123. <xsl:when test="$BiDi='false'">
  124. <Char bold="true" rtl="false">
  125. <xsl:apply-templates />
  126. </Char>
  127. </xsl:when>
  128. <xsl:otherwise>
  129. <Char bold="true" rtl="true">
  130. <xsl:apply-templates />
  131. </Char>
  132. </xsl:otherwise>
  133. </xsl:choose>
  134. <xsl:apply-templates select="$ApplyList"/>
  135. </P>
  136. <xsl:if test="$NewlineList">
  137. <xsl:apply-templates select="$NewlineList"/>
  138. </xsl:if>
  139. </xsl:template>
  140. <xsl:template match="NEWLINE">
  141. <xsl:variable name="NextHeadwordList" select="following-sibling::Headword[1] | following-sibling::Headword[1]/following-sibling::node()"></xsl:variable>
  142. <xsl:variable name="NextNumList" select="following-sibling::Num[1] | following-sibling::Num[1]/following-sibling::node()"></xsl:variable>
  143. <xsl:variable name="NextNewlineList" select="following-sibling::NEWLINE[1] | following-sibling::NEWLINE[1]/following-sibling::node()"></xsl:variable>
  144. <xsl:variable name="CurrentList" select="following-sibling::node()"></xsl:variable>
  145. <xsl:variable name="ExcludeList" select="$NextHeadwordList | $NextNumList | $NextNewlineList"></xsl:variable>
  146. <xsl:variable name="ApplyList" select="$CurrentList [ count( . | $ExcludeList) != count( $ExcludeList) ]"></xsl:variable>
  147. <P>
  148. <xsl:apply-templates/>
  149. <xsl:apply-templates select="$ApplyList"/>
  150. </P>
  151. </xsl:template>
  152. <xsl:template match="Pos">
  153. <Char italic="true">
  154. <xsl:apply-templates />
  155. </Char>
  156. </xsl:template>
  157. <xsl:template match="Posc">
  158. <Char italic="true">
  159. <xsl:apply-templates />
  160. </Char>
  161. </xsl:template>
  162. <xsl:template match="Text">
  163. <Char>
  164. <xsl:apply-templates />
  165. </Char>
  166. </xsl:template>
  167. <xsl:template match="Super">
  168. <Char superscript="true">
  169. <xsl:apply-templates />
  170. </Char>
  171. </xsl:template>
  172. <xsl:template match="Sub">
  173. <Char subscript="true">
  174. <xsl:apply-templates />
  175. </Char>
  176. </xsl:template>
  177. <xsl:template match="Scaps">
  178. <Char smallCaps="true">
  179. <xsl:apply-templates />
  180. </Char>
  181. </xsl:template>
  182. <xsl:template match="Headword2">
  183. <xsl:variable name="sHeadword2">
  184. <xsl:apply-templates />
  185. </xsl:variable>
  186. <xsl:if test="$sHeadword2!=''">
  187. <Char bold="true">
  188. <xsl:apply-templates />
  189. </Char>
  190. </xsl:if>
  191. </xsl:template>
  192. <xsl:template match="text()">
  193. <xsl:value-of select="." />
  194. </xsl:template>
  195. </xsl:stylesheet>
  196.